
#include "Profiler.h"

#include <iostream>

using namespace Iride;

bool Profiler::sPrintEnabled = true;

void Profiler::resetTimer()
{
	mTime = clock();
}

Uint Profiler::getElapsedMs()
{
	clock_t now = clock();

	return ((now - mTime) * 1000) / CLOCKS_PER_SEC;
}

clock_t Profiler::getElapsedClock()
{
	clock_t now = clock();

	return (now - mTime);
}

void Profiler::printElapsedClock(std::string foreText)
{
	if (sPrintEnabled)
	{
		std::cout << foreText << getElapsedClock() << std::endl;
	}
}

void Profiler::printElapsedMs(std::string foreText)
{
	if (sPrintEnabled)
	{
		std::cout << foreText << getElapsedMs() << std::endl;
	}
}


